fix(sap-ai-core): normalize finish_reason and strip assistant prefill - #45320
fix(sap-ai-core): normalize finish_reason and strip assistant prefill#45320Saichandra2520 wants to merge 1 commit into
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: The search for "finish_reason null stop" found PR #43707 which is about chat streams, but that appears to be unrelated to the SAP AI Core provider issue. SummaryNo duplicate PRs found The search results only return the current PR #45320 itself (which is correctly excluded from consideration) and one unrelated PR about console chat streams. There are no open PRs addressing the same SAP AI Core provider bugs regarding |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Issue for this PR
Closes #45313
Closes #45314
Type of change
What does this PR do?
ProviderTransform.messageforsap-ai-coremodels to resolve 400 errors with Claude models on SAP AI Core (which rejects assistant message prefill and requires conversations to end with a user message).sap-ai-coreprovider options andSapAICorePluginto mapfinish_reason: nulltofinish_reason: "stop", fixing the infinite loop with GPT models.How did you verify your code works?
packages/opencode/test/provider/transform.test.tsto test assistant message stripping.packages/opencode/test/provider/sap-ai-core.test.tsandpackages/core/test/plugin/provider-sap-ai-core.test.tsto testfinish_reasonnormalization.bun testand verified all tests pass.tsgo --noEmitto verify type safety.Screenshots / recordings
N/A (provider integration fix)
Checklist